package lesson4.tests;

import lesson4.api.base.TestBase;
import lesson4.api.models.UserModel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;


public class RegistrationPageTests extends TestBase
{
	// Logger
	private static Logger log = LoggerFactory.getLogger(RegistrationPageTests.class);

	public void registrationTest(String p_username, String p_password, String p_firstName, String p_lastName,
			String p_email, String p_skype, String p_phone, String p_department, String p_occupation, boolean p_expectedResult)
	{
		log.info("Start Registration test");
		UserModel userData = new UserModel();
		userData.login = p_username;
		userData.password = p_password;
		userData.firstName = p_firstName;
		userData.lastName = p_lastName;
		userData.email = p_email;
		userData.skypeName = p_skype;
		userData.phone = p_phone;
		userData.department = p_department;
		userData.occupation = p_occupation;

		navigation().toRegistrationPage().register(userData);

		// Check registration
		Assert.assertEquals(page().isRegistered(), p_expectedResult, "Test failed");
	}
}
